﻿using Application.Core.Interfaces;

namespace Application.Core.Entities
{
    public class User : BaseEntity
    {
        private readonly IUserService _userService;
        public User(IUserService userService)
        {
            this._userService = userService;
        }

        
        public string UserId { get; set; }
        public string UserName { get; set; }
        public string Password { get; set; }
        public string Email { get; set; }
        public string UserAlias { get; set; }

        public bool IsAdministrator()
        {
            return true;
        }

        public bool Register()
        {
            return _userService.Create(this); 
        }

        public User GetById(string userId)
        {
            return _userService.GetById(userId);
        }
    }
}
